<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: EncoreBootImageReader.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_encore_boot_image_reader_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">EncoreBootImageReader.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * File:    EncoreBootImageReader.h</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * See included license file for license details.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#if !defined(_EncoreBootImageReader_h_)</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#define _EncoreBootImageReader_h_</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;EncoreBootImage.h&quot;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceelftosb.html">elftosb</a></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html">   17</a></span>&#160;<span class="keyword">class </span><a class="code" href="classelftosb_1_1_encore_boot_image_reader.html">EncoreBootImageReader</a></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html">   23</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html">read_error</a> : <span class="keyword">public</span> std::runtime_error</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html#ae50434e605821cefeca5b48c3454cdd5">   27</a></span>&#160;        <a class="code" href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html#ae50434e605821cefeca5b48c3454cdd5">read_error</a>(<span class="keyword">const</span> std::string &amp;msg)</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;            : <a class="code" href="namespacestd.html">std</a>::runtime_error(msg)</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        {</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        }</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    };</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a57b7000d9a8c4f0910d256d75f1ff4d8">   34</a></span>&#160;    <span class="keyword">typedef</span> std::vector&lt;EncoreBootImage::section_header_t&gt; <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a57b7000d9a8c4f0910d256d75f1ff4d8">section_array_t</a>;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a4109bf2f31263d4bebb2a44fa5d840c2">   37</a></span>&#160;    <span class="keyword">typedef</span> std::vector&lt;EncoreBootImage::boot_command_t&gt; <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a4109bf2f31263d4bebb2a44fa5d840c2">boot_tag_array_t</a>;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#ad7fe16410dc6232cf4b005b533e745af">   41</a></span>&#160;    <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#ad7fe16410dc6232cf4b005b533e745af">EncoreBootImageReader</a>(std::istream &amp;stream)</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        : <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#adc53a887f7cd16089627efcdac7f9d47">m_stream</a>(stream)</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    }</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a3aada13c8e3271e3f81d69188b342d1a">   47</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a3aada13c8e3271e3f81d69188b342d1a">~EncoreBootImageReader</a>() {}</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> setKey(<span class="keyword">const</span> <a class="code" href="class_a_e_s_key.html">AESKey&lt;128&gt;</a> &amp;key) { <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#af93b255e7ff6f1c91acc5263b94ae0a0">m_dek</a> = key; }</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="class_a_e_s_key.html">AESKey&lt;128&gt;</a> &amp;getKey()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#af93b255e7ff6f1c91acc5263b94ae0a0">m_dek</a>; }</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a241c4775a57d7dde3fb6f01ea0882bb7">readImageHeader</a>();</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a393cf18518c6283d9825b26927e21b8f">computeHeaderDigest</a>(sha1_digest_t &amp;digest);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#ad122e17dde6f6d471753454dd534f181">readImageDigest</a>();</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a39ba72de0ae476680054640d014e30ff">computeImageDigest</a>(sha1_digest_t &amp;digest);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#aaff4bdaab6ff40e5a2f416a10aa667d1">readSectionTable</a>();</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a2215b736fcde5b7bc3bffdae5f8dd55c">readKeyDictionary</a>(<span class="keyword">const</span> <a class="code" href="class_a_e_s_key.html">AESKey&lt;128&gt;</a> &amp;kek);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a60ba4e053fbc8b1b1504bec835edf9f2">readBootTags</a>();</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <a class="code" href="classelftosb_1_1_encore_boot_image_1_1_section.html">EncoreBootImage::Section</a> *<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a7910721b98e5f9f4481352ec5ef114c5">readSection</a>(<span class="keywordtype">unsigned</span> index);</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a0457c752be30b64d0e961d94fc1f9e43">isEncrypted</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a54c6ab0a09a64da1e2c451b2d7e1fe37">m_header</a>.<a class="code" href="classelftosb_1_1_encore_boot_image.html#acdca7fd3840a90881556c6adbe74965a">m_keyCount</a> &gt; 0; }</div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a841c2cc66e7d1763a6d64f60fff82f25">   93</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="classelftosb_1_1_encore_boot_image.html#structelftosb_1_1_encore_boot_image_1_1boot__image__header__t">EncoreBootImage::boot_image_header_t</a> &amp;<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a841c2cc66e7d1763a6d64f60fff82f25">getHeader</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a54c6ab0a09a64da1e2c451b2d7e1fe37">m_header</a>; }</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#ab3aefeb886c8118db3c678fe2f278b18">   95</a></span>&#160;    <span class="keyword">const</span> sha1_digest_t &amp;<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#ab3aefeb886c8118db3c678fe2f278b18">getDigest</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#ab110c1baaa3cc58a4754b75767fc89fb">m_digest</a>; }</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a1a37088cba56753d44e3d73ef03fcfea">   97</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> section_array_t &amp;<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a1a37088cba56753d44e3d73ef03fcfea">getSections</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#aae56f7858856d7bd63e025abbb6114bb">m_sections</a>; }</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a1a461d1f0c4dc51e298e31dafc51f60e">   99</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> boot_tag_array_t &amp;<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a1a461d1f0c4dc51e298e31dafc51f60e">getBootTags</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a15d540538f18fbab7bf6ebe6e2ec1467">m_bootTags</a>; }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#adc53a887f7cd16089627efcdac7f9d47">  103</a></span>&#160;    std::istream &amp;<a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#adc53a887f7cd16089627efcdac7f9d47">m_stream</a>;                        </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#af93b255e7ff6f1c91acc5263b94ae0a0">  104</a></span>&#160;    <a class="code" href="class_a_e_s_key.html">AESKey&lt;128&gt;</a> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#af93b255e7ff6f1c91acc5263b94ae0a0">m_dek</a>;                             </div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a54c6ab0a09a64da1e2c451b2d7e1fe37">  105</a></span>&#160;    <a class="code" href="classelftosb_1_1_encore_boot_image.html#structelftosb_1_1_encore_boot_image_1_1boot__image__header__t">EncoreBootImage::boot_image_header_t</a> <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a54c6ab0a09a64da1e2c451b2d7e1fe37">m_header</a>; </div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#ab110c1baaa3cc58a4754b75767fc89fb">  106</a></span>&#160;    sha1_digest_t <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#ab110c1baaa3cc58a4754b75767fc89fb">m_digest</a>;                        </div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#aae56f7858856d7bd63e025abbb6114bb">  107</a></span>&#160;    section_array_t <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#aae56f7858856d7bd63e025abbb6114bb">m_sections</a>;                    </div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classelftosb_1_1_encore_boot_image_reader.html#a15d540538f18fbab7bf6ebe6e2ec1467">  108</a></span>&#160;    boot_tag_array_t <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#a15d540538f18fbab7bf6ebe6e2ec1467">m_bootTags</a>;                   </div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    uint8_t <a class="code" href="classelftosb_1_1_encore_boot_image_reader.html#aca218f39dbbc8505a5cfa3ce42f66854">calculateCommandChecksum</a>(<a class="code" href="classelftosb_1_1_encore_boot_image.html#structelftosb_1_1_encore_boot_image_1_1boot__command__t">EncoreBootImage::boot_command_t</a> &amp;header);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;};</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;}; <span class="comment">// namespace elftosb</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="preprocessor">#endif // _EncoreBootImageReader_h_</span></div><div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a241c4775a57d7dde3fb6f01ea0882bb7"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a241c4775a57d7dde3fb6f01ea0882bb7">elftosb::EncoreBootImageReader::readImageHeader</a></div><div class="ttdeci">void readImageHeader()</div><div class="ttdoc">Reads the header from the image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:20</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_aae56f7858856d7bd63e025abbb6114bb"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#aae56f7858856d7bd63e025abbb6114bb">elftosb::EncoreBootImageReader::m_sections</a></div><div class="ttdeci">section_array_t m_sections</div><div class="ttdoc">The section table. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:107</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_1_1_section_html"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_1_1_section.html">elftosb::EncoreBootImage::Section</a></div><div class="ttdoc">Base class for a section of an Encore boot image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImage.h:989</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a39ba72de0ae476680054640d014e30ff"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a39ba72de0ae476680054640d014e30ff">elftosb::EncoreBootImageReader::computeImageDigest</a></div><div class="ttdeci">void computeImageDigest(sha1_digest_t &amp;digest)</div><div class="ttdoc">Run a SHA-1 digest over the entire image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:107</div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdoc">STL namespace. </div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html">elftosb::EncoreBootImageReader</a></div><div class="ttdoc">Reads a Piano/Encore boot image from an input stream. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:17</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a57b7000d9a8c4f0910d256d75f1ff4d8"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a57b7000d9a8c4f0910d256d75f1ff4d8">elftosb::EncoreBootImageReader::section_array_t</a></div><div class="ttdeci">std::vector&lt; EncoreBootImage::section_header_t &gt; section_array_t</div><div class="ttdoc">An array of section headers. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:34</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_1_1read__error_html"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html">elftosb::EncoreBootImageReader::read_error</a></div><div class="ttdoc">Exception class used for error found while reading a boot image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:23</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_adc53a887f7cd16089627efcdac7f9d47"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#adc53a887f7cd16089627efcdac7f9d47">elftosb::EncoreBootImageReader::m_stream</a></div><div class="ttdeci">std::istream &amp; m_stream</div><div class="ttdoc">The input stream to read the image from. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:103</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a3aada13c8e3271e3f81d69188b342d1a"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a3aada13c8e3271e3f81d69188b342d1a">elftosb::EncoreBootImageReader::~EncoreBootImageReader</a></div><div class="ttdeci">virtual ~EncoreBootImageReader()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:47</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_ab3aefeb886c8118db3c678fe2f278b18"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#ab3aefeb886c8118db3c678fe2f278b18">elftosb::EncoreBootImageReader::getDigest</a></div><div class="ttdeci">const sha1_digest_t &amp; getDigest() const </div><div class="ttdoc">Returns a reference to the SHA-1 digest read from the image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:95</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a0457c752be30b64d0e961d94fc1f9e43"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a0457c752be30b64d0e961d94fc1f9e43">elftosb::EncoreBootImageReader::isEncrypted</a></div><div class="ttdeci">bool isEncrypted() const </div><div class="ttdoc">Returns whether the image is encrypted or not. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:91</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a7910721b98e5f9f4481352ec5ef114c5"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a7910721b98e5f9f4481352ec5ef114c5">elftosb::EncoreBootImageReader::readSection</a></div><div class="ttdeci">EncoreBootImage::Section * readSection(unsigned index)</div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:312</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a54c6ab0a09a64da1e2c451b2d7e1fe37"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a54c6ab0a09a64da1e2c451b2d7e1fe37">elftosb::EncoreBootImageReader::m_header</a></div><div class="ttdeci">EncoreBootImage::boot_image_header_t m_header</div><div class="ttdoc">Header from the boot image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:105</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a2215b736fcde5b7bc3bffdae5f8dd55c"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a2215b736fcde5b7bc3bffdae5f8dd55c">elftosb::EncoreBootImageReader::readKeyDictionary</a></div><div class="ttdeci">bool readKeyDictionary(const AESKey&lt; 128 &gt; &amp;kek)</div><div class="ttdoc">Reads the key dictionary, if the image is encrypted. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:169</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a393cf18518c6283d9825b26927e21b8f"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a393cf18518c6283d9825b26927e21b8f">elftosb::EncoreBootImageReader::computeHeaderDigest</a></div><div class="ttdeci">void computeHeaderDigest(sha1_digest_t &amp;digest)</div><div class="ttdoc">Computes the actual SHA-1 digest of the image header. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:67</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_ad122e17dde6f6d471753454dd534f181"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#ad122e17dde6f6d471753454dd534f181">elftosb::EncoreBootImageReader::readImageDigest</a></div><div class="ttdeci">void readImageDigest()</div><div class="ttdoc">Reads the digest at the end of the image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:79</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a60ba4e053fbc8b1b1504bec835edf9f2"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a60ba4e053fbc8b1b1504bec835edf9f2">elftosb::EncoreBootImageReader::readBootTags</a></div><div class="ttdeci">void readBootTags()</div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:237</div></div>
<div class="ttc" id="namespaceelftosb_html"><div class="ttname"><a href="namespaceelftosb.html">elftosb</a></div><div class="ttdef"><b>Definition:</b> BootImage.h:13</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a15d540538f18fbab7bf6ebe6e2ec1467"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a15d540538f18fbab7bf6ebe6e2ec1467">elftosb::EncoreBootImageReader::m_bootTags</a></div><div class="ttdeci">boot_tag_array_t m_bootTags</div><div class="ttdoc">The array of boot tags read from the image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:108</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_ab110c1baaa3cc58a4754b75767fc89fb"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#ab110c1baaa3cc58a4754b75767fc89fb">elftosb::EncoreBootImageReader::m_digest</a></div><div class="ttdeci">sha1_digest_t m_digest</div><div class="ttdoc">SHA-1 digest as read from the image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:106</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_html_structelftosb_1_1_encore_boot_image_1_1boot__command__t"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image.html#structelftosb_1_1_encore_boot_image_1_1boot__command__t">elftosb::EncoreBootImage::boot_command_t</a></div><div class="ttdoc">Structure for a Piano bootloader command. </div><div class="ttdef"><b>Definition:</b> EncoreBootImage.h:249</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a1a461d1f0c4dc51e298e31dafc51f60e"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a1a461d1f0c4dc51e298e31dafc51f60e">elftosb::EncoreBootImageReader::getBootTags</a></div><div class="ttdeci">const boot_tag_array_t &amp; getBootTags() const </div><div class="ttdoc">Returns a reference to the STL container holding the boot tags. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:99</div></div>
<div class="ttc" id="class_a_e_s_key_html"><div class="ttname"><a href="class_a_e_s_key.html">AESKey&lt; 128 &gt;</a></div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a1a37088cba56753d44e3d73ef03fcfea"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a1a37088cba56753d44e3d73ef03fcfea">elftosb::EncoreBootImageReader::getSections</a></div><div class="ttdeci">const section_array_t &amp; getSections() const </div><div class="ttdoc">Returns a reference to the STL container holding the section headers. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:97</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_html_acdca7fd3840a90881556c6adbe74965a"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image.html#acdca7fd3840a90881556c6adbe74965a">elftosb::EncoreBootImage::boot_image_header_t::m_keyCount</a></div><div class="ttdeci">uint16_t m_keyCount</div><div class="ttdoc">Number of entries in DEK dictionary. </div><div class="ttdef"><b>Definition:</b> EncoreBootImage.h:168</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_aaff4bdaab6ff40e5a2f416a10aa667d1"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#aaff4bdaab6ff40e5a2f416a10aa667d1">elftosb::EncoreBootImageReader::readSectionTable</a></div><div class="ttdeci">void readSectionTable()</div><div class="ttdoc">Read the plaintext section table entries. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:131</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a4109bf2f31263d4bebb2a44fa5d840c2"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a4109bf2f31263d4bebb2a44fa5d840c2">elftosb::EncoreBootImageReader::boot_tag_array_t</a></div><div class="ttdeci">std::vector&lt; EncoreBootImage::boot_command_t &gt; boot_tag_array_t</div><div class="ttdoc">An array of boot tags. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:37</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_aca218f39dbbc8505a5cfa3ce42f66854"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#aca218f39dbbc8505a5cfa3ce42f66854">elftosb::EncoreBootImageReader::calculateCommandChecksum</a></div><div class="ttdeci">uint8_t calculateCommandChecksum(EncoreBootImage::boot_command_t &amp;header)</div><div class="ttdoc">Calculates the 8-bit checksum on a boot command header. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.cpp:291</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_a841c2cc66e7d1763a6d64f60fff82f25"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#a841c2cc66e7d1763a6d64f60fff82f25">elftosb::EncoreBootImageReader::getHeader</a></div><div class="ttdeci">const EncoreBootImage::boot_image_header_t &amp; getHeader() const </div><div class="ttdoc">Returns a reference to the image&amp;#39;s header. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:93</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_af93b255e7ff6f1c91acc5263b94ae0a0"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#af93b255e7ff6f1c91acc5263b94ae0a0">elftosb::EncoreBootImageReader::m_dek</a></div><div class="ttdeci">AESKey&lt; 128 &gt; m_dek</div><div class="ttdoc">DEK (data encryption key) read from the key dictionary. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:104</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_html_structelftosb_1_1_encore_boot_image_1_1boot__image__header__t"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image.html#structelftosb_1_1_encore_boot_image_1_1boot__image__header__t">elftosb::EncoreBootImage::boot_image_header_t</a></div><div class="ttdoc">Header for the entire boot image. </div><div class="ttdef"><b>Definition:</b> EncoreBootImage.h:150</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_html_ad7fe16410dc6232cf4b005b533e745af"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader.html#ad7fe16410dc6232cf4b005b533e745af">elftosb::EncoreBootImageReader::EncoreBootImageReader</a></div><div class="ttdeci">EncoreBootImageReader(std::istream &amp;stream)</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:41</div></div>
<div class="ttc" id="classelftosb_1_1_encore_boot_image_reader_1_1read__error_html_ae50434e605821cefeca5b48c3454cdd5"><div class="ttname"><a href="classelftosb_1_1_encore_boot_image_reader_1_1read__error.html#ae50434e605821cefeca5b48c3454cdd5">elftosb::EncoreBootImageReader::read_error::read_error</a></div><div class="ttdeci">read_error(const std::string &amp;msg)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> EncoreBootImageReader.h:27</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_96c2f84c885cff71a930b6845f88cdd3.html">elftosb</a></li><li class="navelem"><a class="el" href="dir_c476059e18722267e10e2fb2cca6f785.html">common</a></li><li class="navelem"><b>EncoreBootImageReader.h</b></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:50 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
